{% extends 'layouts/base.html' %}
{% block content %}
<div class="row">
    <div class="col-xs-12">
        <!-- PAGE CONTENT BEGINS -->
        <form action="{{ url('backend/wsuser/add') }}" class="form-horizontal" role="form" method="post" enctype="multipart/form-data">

            <div class="form-group{% if errors['·subscribe·'] is not empty %} has-error{%endif%}">
                <label for="·subscribe·" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">是否关注该公众号<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="·subscribe·" placeholder="是否关注该公众号" name="·subscribe·" class="col-xs-12" value="{{wsuser.·subscribe·}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['·subscribe·'] is not empty %}{{errors['·subscribe·']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['openid'] is not empty %} has-error{%endif%}">
                <label for="openid" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">公众号唯一ID<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="openid" placeholder="公众号唯一ID" name="openid" class="col-xs-12" value="{{wsuser.openid}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['openid'] is not empty %}{{errors['openid']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['·nickname·'] is not empty %} has-error{%endif%}">
                <label for="·nickname·" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">用户昵称<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="·nickname·" placeholder="用户昵称" name="·nickname·" class="col-xs-12" value="{{wsuser.·nickname·}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['·nickname·'] is not empty %}{{errors['·nickname·']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['·sex·'] is not empty %} has-error{%endif%}">
                <label for="·sex·" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">用户的性别，值为1时是男性，值为2时是女性，值为0时是未知<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="·sex·" placeholder="用户的性别，值为1时是男性，值为2时是女性，值为0时是未知" name="·sex·" class="col-xs-12" value="{{wsuser.·sex·}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['·sex·'] is not empty %}{{errors['·sex·']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['city'] is not empty %} has-error{%endif%}">
                <label for="city" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">所在城市<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="city" placeholder="所在城市" name="city" class="col-xs-12" value="{{wsuser.city}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['city'] is not empty %}{{errors['city']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['county'] is not empty %} has-error{%endif%}">
                <label for="county" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">所在国家<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="county" placeholder="所在国家" name="county" class="col-xs-12" value="{{wsuser.county}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['county'] is not empty %}{{errors['county']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['province'] is not empty %} has-error{%endif%}">
                <label for="province" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">所在省份<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="province" placeholder="所在省份" name="province" class="col-xs-12" value="{{wsuser.province}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['province'] is not empty %}{{errors['province']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['language'] is not empty %} has-error{%endif%}">
                <label for="language" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">用户语言<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="language" placeholder="用户语言" name="language" class="col-xs-12" value="{{wsuser.language}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['language'] is not empty %}{{errors['language']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['headimgurl'] is not empty %} has-error{%endif%}">
                <label for="headimgurl" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">用户头像<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="headimgurl" placeholder="用户头像" name="headimgurl" class="col-xs-12" value="{{wsuser.headimgurl}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['headimgurl'] is not empty %}{{errors['headimgurl']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['subscribe_time'] is not empty %} has-error{%endif%}">
                <label for="subscribe_time" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">关注时间<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="subscribe_time" placeholder="关注时间" name="subscribe_time" class="col-xs-12" value="{{wsuser.subscribe_time}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['subscribe_time'] is not empty %}{{errors['subscribe_time']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['unionid'] is not empty %} has-error{%endif%}">
                <label for="unionid" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">只有在用户将公众号绑定到微信开放平台帐号后，才会出现该字段<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="unionid" placeholder="只有在用户将公众号绑定到微信开放平台帐号后，才会出现该字段" name="unionid" class="col-xs-12" value="{{wsuser.unionid}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['unionid'] is not empty %}{{errors['unionid']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['remark'] is not empty %} has-error{%endif%}">
                <label for="remark" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">备注<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="remark" placeholder="备注" name="remark" class="col-xs-12" value="{{wsuser.remark}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['remark'] is not empty %}{{errors['remark']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['groupid'] is not empty %} has-error{%endif%}">
                <label for="groupid" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">用户所在的分组ID<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="groupid" placeholder="用户所在的分组ID" name="groupid" class="col-xs-12" value="{{wsuser.groupid}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['groupid'] is not empty %}{{errors['groupid']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['status'] is not empty %} has-error{%endif%}">
                <label for="status" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">状态<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="status" placeholder="状态" name="status" class="col-xs-12" value="{{wsuser.status}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['status'] is not empty %}{{errors['status']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['addtime'] is not empty %} has-error{%endif%}">
                <label for="addtime" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">添加时间<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="addtime" placeholder="添加时间" name="addtime" class="col-xs-12" value="{{wsuser.addtime}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['addtime'] is not empty %}{{errors['addtime']}}{% else %} {%endif%} </div>
            </div>



            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info" type="submit">
                        <i class="ace-icon fa fa-check bigger-110"></i>
                        提交
                    </button>

                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="ace-icon fa fa-undo bigger-110"></i>
                        重置
                    </button>
                </div>
            </div>
        </form>
    </div><!-- /.col -->
</div><!-- /.row -->

{% endblock %}
{% block script %}

<script type="text/javascript">
    $(document).ready(function(){

        $(".ace-switch").each(function () {
            var aceswitch = this;

            aceswitch.addEventListener("click", function(){
                id = this.id.replace("_radio", "");
                if(this.checked){
                    $("#"+id).val('1');
                } else {
                    $("#"+id).val('0');
                }
                });
        });
    });
</script>
{% endblock %}
